{	30 January 2011. Individual Olympiad. Problem set: http://neerc.ifmo.ru/school/io/archive/20110130/problems-individual-20110130.pdf
	Problem D
	Points: 16	
}

uses SysUtils;
var n:int64;  i:longint;
begin
reset(input,'taxibus.in');
rewrite(output,'taxibus.out');
readln(n);
if n=2 then begin
  writeln(0);
  writeln('2 1');
end else
if n=5 then begin
  writeln(2);
  writeln('10 2 4 1 1');
end else begin
  writeln(0);
  for i:=n downto 1 do write(i,' ');
end;
end.
 